%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Option Explicit
Const Version="2.06"
%>
<%
'Image Copyright text (will apply to every picture)
sub WriteCopyRightText()
%>
<%
end sub
' -- COMMENT TRIGGER ---
'Do whatever you want then a visitor write a comment (send and email to the admin, for example)
sub OnCommentAdded(author,email,text,picturelink)
if cSendEmailOnCommentAdded then
Dim subject: subject= cPageTitle & " v:" & Version & " comment"
Dim body: body = vbcrlf & "Author: " & author & vbcrlf & _
"Email: " & email & vbcrlf & _
"Comments: " & text & vbcrlf & _
"Picture: " & picturelink & vbcrlf
Dim result: result=SendEmail(cAdminEmail,cAdminEmail,cAdminEmail,subject,body)
if result="1" then
'success
else
'error handling
err.Raise 1,"OnCommentAdded", result
end if
end if
'here you could trigger other actions when user writes a comment.
end sub
'MAIN
'on error resume next 'comment this line for debugging purposes
%>
<%
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
'security check
if cAllowAnonymousVisitors = false and not SessionIsAuthenticated then
response.redirect "login.asp"
end if
Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")
Dim strThispage 'important to avoid 405 errors in "post"
strThispage= Request.ServerVariables ("SCRIPT_NAME")
Dim sizeValues
sizeValues = split(cAvailableBigImageSizes,",") 'converting valid image values to array
Dim tempWriter 'use to store temporal values along the script
Dim IDcounter 'to assing unique ID's
IDcounter=0
if len(request("targetimgsize")) > 0 then session("targetimgsize")=request("targetimgsize")
if len(session("targetimgsize"))=0 then session("targetimgsize")=cDefaultBigImageSize
if isnumeric(request("picsperrow")) and len(request("picsperrow")) > 0 then session("picsperrow")=cint(request("picsperrow"))
if not isnumeric(session("picsperrow")) or len(session("picsperrow"))=0 then session("picsperrow")=cNumberPicturesPerRowDefault
if len(request("targetimgsize")) > 0 then session("targetimgsize")=request("targetimgsize")
if len(session("targetimgsize"))=0 then session("targetimgsize")=cDefaultBigImageSize
'thumbnail size
if len(request("thumbnailsize"))>0 then 'user is changing thumbnail size
if isnumeric(request("thumbnailsize")) and cint(request("thumbnailsize"))>0 and cint(request("thumbnailsize")) <= cMaxAllowedThumbnailsSize then
session("thumbnailsize")=request("thumbnailsize")
end if
elseif len(session("thumbnailsize"))=0 then
session("thumbnailsize")=cDefaultThumbnailsSize ' set default size
end if
%>
<%=cPageTitle%>
<%
Select case request("action")
case "displayfiles"
response.clear
Prt("")
Call DisplayFiles(request("item"),1)
Prt("
")
Case "recent"
displayRecentComments (cNumberRecentComments)
case "empty"
case "search"
Prt ("Risultato della ricerca per " & request("search") & "
")
dosearch
case "displayimage"
response.clear
DisplayMain(request("item"))
case "rsscomments"
dim top: top=0
if request("top") <> "" then top=request("top")
Call RssComment (request("image"),top)
case "displaypage"
Response.redirect (request("Item"))
case "imagecomments"
session("defaultaction") ="comments"
Writecomments()
case "sendtofriend"
session("defaultaction") ="sendtofriend"
sendtofriend()
case "imagealerts"
session("defaultaction") ="alerts"
subscribeforalerts()
case "exifinfo":
session("defaultaction") = "exifinfo"
response.redirect ("addons/exif/exif.aspx?path=" & request("path"))
case "rsslink"
'rss feed
Prt ""
'rss feed
Prt ""
case "showblank"
Response.end
case "showfirst"
Call Showfirst(request("item"))
case else
%>
<%
End select
raisealerts() 'raise alerts, if any
if len(request("goto"))>0 then
Dim image:image=request("goto")
if not fs.FileExists(server.mappath(image)) then
' doesn't exist as image. Is a folder?
image=GetFirstPicture(image)
end if
response.write ""
'calculate folder from item path
Dim folder: folder=fs.GetParentFolderName(request("goto")) & "/"
response.write ""
end if
Set fs=nothing
if err then
Prt "Error: " & err.description + ". Source: " & err.source & " .
"
end if
%>